package luogu;

import java.util.Scanner;

public class P5015 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        s = s.replace(" ", "");
        System.out.println(s.length());
    }
}
